<template>
    <el-container style="height:100vh">
        <el-aside width="200px" style="background-color: white">
            <img class="home-img" src="../../assets/imgs/logo.png" alt="" />
            <el-menu
                router
                :default-openeds="['1', '2']"
                :default-active="$route.path"
            >
                <el-submenu index="1">
                    <template slot="title"
                        ><i class="el-icon-message"></i>音乐管理</template
                    >
                    <el-menu-item-group>
                        <template slot="title">音乐管理</template>
                        <el-menu-item index="/music/create"
                            >创建歌曲</el-menu-item
                        >
                        <el-menu-item index="/music/list"
                            >歌曲列表</el-menu-item
                        >
                    </el-menu-item-group>
                    <el-menu-item-group>
                        <template slot="title">歌单管理</template>
                        <el-menu-item index="/musicList/create"
                            >创建歌单</el-menu-item
                        >
                        <el-menu-item index="/musicList/list"
                            >歌单列表</el-menu-item
                        >
                    </el-menu-item-group>
                </el-submenu>
                <el-submenu index="2">
                    <template slot="title"
                        ><i class="el-icon-menu"></i>文章管理</template
                    >
                    <el-menu-item-group>
                        <template slot="title">文章管理</template>
                        <el-menu-item index="/news/create"
                            >创建文章</el-menu-item
                        >
                        <el-menu-item index="/news/list">文章列表</el-menu-item>
                    </el-menu-item-group>
                </el-submenu>
                <el-submenu index="3">
                    <template slot="title"
                        ><i class="el-icon-menu"></i>管理员管理</template
                    >
                    <el-menu-item-group>
                        <template slot="title">管理员管理</template>
                        <el-menu-item index="/admin/create"
                            >创建管理员</el-menu-item
                        >
                        <el-menu-item index="/admin/list"
                            >管理员列表</el-menu-item
                        >
                    </el-menu-item-group>
                </el-submenu>
            </el-menu>
        </el-aside>

        <el-container>
            <el-header style="text-align: right; font-size: 12px">
                <span>管理员</span>
            </el-header>

            <el-main>
                <router-view :key="$route.path"></router-view>
            </el-main>
        </el-container>
    </el-container>
</template>

<script>
// @ is an alias to /src

export default {
    name: "Home",
    components: {},
    data() {
        return {};
    },
};
</script>

<style scoped>
.el-header {
    background-color: #b3c0d1;
    color: #333;
    line-height: 60px;
}

.el-aside {
    color: #333;
}
.el-menu {
    border-top: 1px solid black;
}
.home-img {
    display: block;
    height: 60px;
    width: auto;
    margin-left: 40px;
}
</style>
